<!-- 1 定义组件模版 --> 
<template>
    <div>
        css   使用params的详情
         <div>id:{{ params.id }}</div>
         <div>title:{{ params.title }}</div>
         <div>content:{{ params.content}}</div>
 
 
    </div>
 </template> 
 
 <!-- 2 定义组件逻辑 -->
 <script setup lang="ts" name="CssDetail"> 
 import { ref ,toRef,toRefs,onMounted,onUnmounted} from 'vue'			
  import {useRoute} from 'vue-router'
 
 //获取当前的路由
  let route  = useRoute();
   
//   const params = route.params
const params = toRef(route,"params")
// const {params} = toRefs(route)
  
  console.log(
    '%c route: ',
    'background-color: #3756d4; padding: 4px 8px; border-radius: 2px; font-size: 14px; color: #fff; font-weight: 700;',
    route 
  )


  
 </script> 
  
 <!-- 3 定义样式 -->
 <style scoped> 
  div{
     margin: 5px;
  }
 </style>